//引入react jsx写法的必须
import React from 'react';
//引入需要用到的页面组件 
import Home from './../pages/Home';
import Cart from './../pages/Cart';
import Footer from './../components/Footer/footer'
//引入一些模块
import { BrowserRouter as Router, Route, Switch, Redirect } from "react-router-dom";

function router() {
    return (
        <Router>
            <Switch>
                <Route path="/home" exact component={Home} />
                <Route path="/cart" exact component={Cart} />
                <Redirect to="/home" from='/*' />
            </Switch>
            <Footer />
        </Router>);
}

export default router;